package com.mtsmda.oracleOfficialTutorialJAVA7.chapter1;

public class MethodParam {

	public static void main(String[] args) {
		Circle circle = new Circle(15, 15);
		System.out.println(circle);
		System.out.println(new MethodParam().moveCircle(circle, 19, 19));
		System.out.println(circle);
	}

	public Circle moveCircle(Circle circle, int deltaX, int deltaY) {
		circle.setX(circle.getX() + deltaX);
		circle.setY(circle.getY() + deltaY);

		circle = new Circle(0, 0);
//		circle.setX(0);
//		circle.setY(0);
		return circle;
	}

}

class Circle {
	private int x;
	private int y;

	public Circle() {

	}

	public Circle(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	@Override
	public String toString() {
		return "Circle [x=" + x + ", y=" + y + "]";
	}

}